package cn.oldsix.spark.utils;

import java.io.*;
import java.util.Properties;

/*
 * @Author : Wu.D.J
 * @Create : 2018.09.15
 **/
public final class PropertiesUtil {

    private PropertiesUtil() {

    }

    public static Properties getProperties(String filePath) throws IOException {

        Properties props = null;
        InputStream input = null;

        try {
            input = new BufferedInputStream(new FileInputStream(new File(filePath)));
            props = new Properties();
            props.load(input);
        } catch (IOException e) {
            throw e;
        } finally {
            if (input != null) {
                input.close();
            }
        }

        return props;
    }
}
